import API from "./service";

export const test = function () {
  return new Promise((resolve, reject) => {
    API.post("/file/getFileslist", {})
      .then((res) => {
        resolve(res);
      })
      .catch((err) => {
        reject(err);
      });
  });
};

export const getNavList = function () {
  return new Promise((resolve, reject) => {
    API.post("/file/getNavList", {})
      .then((res) => {
        resolve(res);
      })
      .catch((err) => {
        reject(err);
      });
  });
};


export const getFilesNameList = function () {
  return new Promise((resolve, reject) => {
    API.post("/file/getFilesNameList", {name:'111',value:"11"})
      .then((res) => {
        resolve(res);
      })
      .catch((err) => {
        reject(err);
      });
  });
};

export const addNavData = function (data) {
  return new Promise((resolve, reject) => {
    API.post("/file/addNavData", data)
      .then((res) => {
        resolve(res);
      })
      .catch((err) => {
        reject(err);
      });
  });
};

export const getFilesList = function (data) {
  return new Promise((resolve, reject) => {
    API.get("/dic/getFilesList", data)
      .then((res) => {
        resolve(res);
      })
      .catch((err) => {
        reject(err);
      });
  });
};

export const getClassList = function (data) {
  return new Promise((resolve, reject) => {
    API.get("/dic/getClassList", data)
      .then((res) => {
        resolve(res);
      })
      .catch((err) => {
        reject(err);
      });
  });
};

export const uploadImg = function (data) {
  return new Promise((resolve, reject) => {
    API.post("/api/doc/upload", data)
      .then((res) => {
        resolve(res);
      })
      .catch((err) => {
        reject(err);
      });
  });
};
export const login = function (data) {
  return new Promise((resolve, reject) => {
    API.post("/api/login", data)
      .then((res) => {
        resolve(res);
      })
      .catch((err) => {
        reject(err);
      });
  });
};